/*
 * @Description:
 * @Author:  huangshuai
 * @Date: 2023-10-31 10:43:25
 * @LastEditTime: 2023-11-29 10:49:31
 * @LastEditors: huangshuai
 */
import axios from "@/utils/request";

//上传图片
export function uploadFile(file: any, fileNameList: any, uploadType: any) {
  return axios.service({
    url: "/common/uploadFileToMinio",
    method: "post",
    data: { files: file.raw, fileNameList, uploadType },
    headers: {
      "Content-Type": "multipart/form-data",
      // Cookie:
      //   "JSESSIONID=B9739734D721C61A61CB9CF1C13E8AEE;Idea-d2aec2c=b627c03d-fb21-4ee0-be8c-a0bdc94ccc8e;Hm_lvt_d214947968792b839fd669a4decaaffc=1687741637,1688083438",
    },
  });
}
//上传音乐等大文件
export function uploadBigFileToMinIO(file: any, uploadType: string = "5") {
  return axios.service({
    url: "/common/uploadBigFileToMinIO",
    method: "post",
    data: { file, uploadType },
    headers: {
      "Content-Type": "multipart/form-data",
      // Cookie:
      //   "JSESSIONID=B9739734D721C61A61CB9CF1C13E8AEE;Idea-d2aec2c=b627c03d-fb21-4ee0-be8c-a0bdc94ccc8e;Hm_lvt_d214947968792b839fd669a4decaaffc=1687741637,1688083438",
    },
  });
}
//获取文件信息
export function listFileInfo(
  page: number = 1,
  pageSize: number = 10,
  type: number = 5
) {
  return axios.service({
    url: `/common/listFileInfo?page=${page}&pageSize=${pageSize}&type=${type}`,
    method: "get",
  });
}
